package com.yzxb.messystem.service;

import com.yzxb.messystem.entity.WorkOrder;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Optional;

public interface WorkOrderService {
    
    // 获取所有工单
    List<WorkOrder> getAllWorkOrders();
    
    // 根据ID获取工单
    Optional<WorkOrder> getWorkOrderById(Long id);
    
    // 根据工单编码获取工单
    Optional<WorkOrder> getWorkOrderByCode(String orderCode);
    
    // 添加工单
    WorkOrder addWorkOrder(WorkOrder workOrder);
    
    // 更新工单
    WorkOrder updateWorkOrder(Long id, WorkOrder workOrder);
    
    // 删除工单
    void deleteWorkOrder(Long id);
    
    // 根据状态查询工单
    List<WorkOrder> getWorkOrdersByStatus(WorkOrder.OrderStatus status);
    
    // 根据产品线查询工单
    List<WorkOrder> getWorkOrdersByProductionLine(String productionLine);
    
    // 根据产品ID查询工单
    List<WorkOrder> getWorkOrdersByProductId(Long productId);
    
    // 根据日期范围查询工单
    List<WorkOrder> getWorkOrdersByDateRange(LocalDateTime startDate, LocalDateTime endDate);
    
    // 更改工单状态
    WorkOrder changeWorkOrderStatus(Long id, WorkOrder.OrderStatus status);
    
    // 更新工单数量
    WorkOrder updateWorkOrderQuantities(Long id, Integer completedQuantity, Integer rejectedQuantity);
}